<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>评论首页</title>
</head>
<body>
<button><a href="/manage/">返回首页</a></button>
<form action="/manage/comments/{{ article.0.id }}" method="get">
    评论内容：<input type="text" name="comments_content" value="{{ comments_content }}" />
    <input type="submit" value="查询" />
</form>
<button><a href="/manage/comments/add/{{ article.0.id }}">新增评论</a></button>
<br>
<table border="1">
    <thead>
    <tr>
        <th colspan="6">{{ article.0.article_title }}</th>
    </tr>
    <tr>
        <th><input type="checkbox" name="all" id="all"></th>
        <th>编号</th>
        <th>评论人</th>
        <th>评论内容</th>
        <th>评论时间</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {% for comment in current_page %}
        <tr>
            <td>
                <input type="checkbox" name="ids" value="{{ article.id }}" />
            </td>
            <td>{{ comment.id }}</td>
            <td>{{ comment.create_user.user_name }}</td>
            <td>{{ comment.comments_content }}</td>
            <td>{{ comment.comments_time|date:'Y-m-d' }}</td>
            <td>
                <a href="/manage/comments/update/{{ comment.id }}">修改</a> <br>
                <a href="/manage/comments/del/{{ comment.id }}">删除</a>
            </td>
        </tr>
    {% empty %}
        <td>暂无数据</td>
    {% endfor %}
    </tbody>
</table>
<div>
    {% if current_page.has_previous %}
        <a href="/manage/comments/{{ article.0.id }}?page_index={{ current_page.previous_page_number }}&comments_content={{ comments_content }}">
            上一页
        </a>
    {% endif %}
    {% for page_index in paginator.page_range %}
        <a href="/manage/comments/{{ article.0.id }}?page_index={{ page_index }}&comments_content={{ comments_content }}">{{ page_index }}</a>
    {% endfor %}
    {% if current_page.has_next %}
        <a href="/manage/comments/{{ article.0.id }}?page_index={{ current_page.next_page_number }}&comments_content={{ comments_content }}">
            下一页
        </a>
    {% endif %}
    共有：{{ paginator.count }}
</div>
</body>
</html>